package com.enotourister.core.provider;

import com.enotourister.core.model.Contract;
import com.enotourister.core.pool.Pool;
import com.enotourister.core.proposal.Proposal;
import com.enotourister.core.rfp.RequestForProposal;

class ProviderImpl implements Provider {
	private static final long serialVersionUID = 1160916874672950482L;
	
	@Override
	public void requestProposal(RequestForProposal rfp) {
		// Generating proposal
		//TODO: Add logic to generate proposals... Each provider adds its proposal impl
		@SuppressWarnings("serial")
		Proposal proposal = new Proposal("Proposal: " + Math.random(), rfp, this) { };
		
		// Adding proposal to the pool
		Pool pool = Pool.getInstance();
		pool.addProposal(proposal);
	}

	@Override
	public Boolean contractProposal(Proposal proposal) {
		// TODO Include logic
		System.out.println("Provider: Contract proposal " + proposal);
		return true;
	}

	@Override
	public void informContract(Contract contract) {
		// TODO Do something with this info
		System.out.println("Provider: Inform contract " + contract);
	}
	
}
